<?php
namespace app\admin\controller;

use app\admin\service\ConfigService;

class Wechatapp extends CommonController
{
    public function config()
    {
        if ($this->isAjax())
        {
            $request = $this->request;
            $formData = $request['form'];
            $formData['pic'] = json_encode($formData['pic']);
            ConfigService::setConf('sys_wechatapp', 'admin', $formData, '小程序基础配置');
        }
        $data = ConfigService::getConf('sys_wechatapp', 'admin');
        $data['pic'] = json_decode($data['pic'], true);
        return view('', ['data' => $data]);
    }
}
